<style>

    .address {
        position: relative;
        overflow: hidden;
        line-height: 25px;
        cursor: pointer;
        background: #f8f8f8;
        padding: 15px;
    }

    .address .ribbon-wrapper {
        display: none;
    }

    .address.active .ribbon-wrapper {
        display: block;
    }

    .address:hover {
        background: #efefef;
    }

    .address.active {
        background: #efefef;
    }

    .address .ribbon-wrapper {
        position: absolute;
        top: 0;
        right: 0;
        overflow: hidden;
        width: 80px;
        height: 85px;
    }

    .ribbon {
        font-size: 10px;
        position: relative;
        top: 17px;
        left: -8px;
        width: 120px;
        padding: 1px;
        color: #fff;
        text-align: center;
        background-color: #ff3100;
        text-transform: uppercase;
        z-index: 2;
        -webkit-transform: rotate(45deg);
        -moz-transform: rotate(45deg);
        -ms-transform: rotate(45deg);
        -o-transform: rotate(45deg);
    }
</style>
<div class="container">
    <div class="section">
        <div class="row">
            <div class="col-md-3">
                {include file="common/sidenav" /}
            </div>
            <div class="col-md-9">
                <div class="panel panel-default">
                    <div class="panel-body">
                        <h2 class="page-header" style="margin-bottom:15px;">
                            {:isset($address)&&isset($address.id) && $address?'编辑':'添加'}收货地址
                            <div class="pull-right">
                                <a href="{:url('index/shop.address/index')}" class="btn btn-primary">返回</a>
                            </div>
                        </h2>
                        <div>
                            <form name="addressform" action="{:url('shop.address/save')}" method="post">
                                <input type="hidden" name="id" value="{$address.id|default=''}"/>
                                <div class="row">
                                    <div class="col-xs-12 col-sm-3">
                                        <div>
                                            <div class="form-group">
                                                <label>收货人姓名</label>
                                                <input type="text" class="form-control" name="receiver" placeholder="" value="{$address.receiver|default=''}">
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <div class="row">
                                    <div class="col-xs-12 col-sm-9">
                                        <div class="form-group" id="cityselect">
                                            <label>省市区</label>
                                            <div class="row" data-toggle="cxselect" data-selects="province_id,city_id,area_id">
                                                <div class="col-xs-12 col-sm-4">
                                                    <select class="province_id form-control" name="province_id" data-url="shop.address/area">
                                                        {if $areainfo && $areainfo.province}
                                                        <option value="{$areainfo.province.id}">{$areainfo.province.name}</option>
                                                        {/if}
                                                    </select>
                                                </div>
                                                <div class="col-xs-12 col-sm-4">
                                                    <select class="city_id form-control" name="city_id" data-url="shop.address/area">
                                                        {if $areainfo && $areainfo.city}
                                                        <option value="{$areainfo.city.id}">{$areainfo.city.name}</option>
                                                        {/if}
                                                    </select>
                                                </div>
                                                <div class="col-xs-12 col-sm-4">
                                                    <select class="area_id form-control" name="area_id" data-url="shop.address/area">
                                                        {if $areainfo && $areainfo.area}
                                                        <option value="{$areainfo.area.id}">{$areainfo.area.name}</option>
                                                        {/if}
                                                    </select>
                                                </div>
                                            </div>
                                        </div>

                                    </div>
                                </div>
                                <div class="row">
                                    <div class="col-xs-12 col-sm-9">
                                        <div class="form-group">
                                            <label>详细地址</label>
                                            <input type="text" class="form-control" name="address" placeholder="请输入详细的地址" value="{$address.address|default=''}">
                                        </div>
                                    </div>
                                </div>
                                <div class="row">
                                    <div class="col-xs-12 col-sm-3">
                                        <div class="form-group">
                                            <label>手机号</label>
                                            <input type="text" class="form-control" name="mobile" value="{$address.mobile|default=''}" placeholder="">
                                        </div>
                                    </div>
                                </div>
                                <div class="row">
                                    <div class="col-xs-12 col-sm-3">
                                        <div class="form-group">
                                            <div class="checkbox">
                                                <label>
                                                    <input type="checkbox" value="1" id="isdefault" name="isdefault" {:isset($address)&&$address.isdefault?'checked':''}>
                                                                                                                                                           设为默认地址
                                                </label>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <div class="row">
                                    <div class="col-xs-12 col-sm-6">
                                        <div class="form-group">
                                            <a href="javascript:;" class="btn btn-primary btn-saveaddress">保存</a>
                                        </div>
                                    </div>
                                </div>
                            </form>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
